﻿@(
Html.X().Panel()
                    .ItemID("north")
                    .Height(100)
                    .Header(false)
                    .Border(false)
                    .Region(Region.North)
                    .TopBar(Html.X().Toolbar().Items(items =>
                    {
                        items.Add(new ToolbarTextItem { Text = "当前登录用户:" });
                        items.Add(new HyperLink { Text = @User.Identity.Name });

                        items.Add(new ToolbarSpacer());
                        items.Add(new ToolbarSeparator());
                        items.Add(new ToolbarSpacer());

                        items.Add(new HyperLink { Text = "注销登录",NavigateUrl = "/Account/Logout" });

                        items.Add(new ToolbarSpacer());
                        items.Add(new ToolbarSeparator());
                        items.Add(new ToolbarSpacer());

                        items.Add(new HyperLink { Text = "Messages (3)" });

                        items.Add(new ToolbarSpacer());
                        items.Add(new ToolbarSeparator());
                        items.Add(new ToolbarSpacer());

                        items.Add(new HyperLink { Text = "Help" });

                        items.Add(new ToolbarFill());

                        items.Add(new Button
                        {
                            Text = "My Account",
                            Margins = "0 20 0 0",
                            Listeners = {
                                Click = {
                                    Handler = "Ext.Msg.alert(Ext.getBody().getSize().width.toString());"
                                }
                            },
                            Menu =
                            {
                                new Menu{
                                    Items = { 
                                        new MenuItem { Text =  "Settings", Icon = Icon.Cog },
                                        new MenuItem { Text =  "About", Icon = Icon.Information }
                                    }
                                }
                            }
                        });
                    }))
                    .Layout(LayoutType.Card)
                    .Items(
                        Html.X().Container()
                            .Layout(LayoutType.HBox)
                            .LayoutConfig(new HBoxLayoutConfig { Align = HBoxAlign.Middle })
                            .Items(items =>
                            {
                                items.Add(new Image
                                {
                                    ImageUrl = "~/Content/companyx_logo.png",
                                    Width = 296,
                                    Height = 72
                                });
                                items.Add(Html.X().Container().Flex(1));

                                items.Add(new Container
                                {
                                    LayoutConfig = {
                                        new HBoxLayoutConfig {Align = HBoxAlign.Middle, Pack = BoxPack.End}
                                    },
                                    Width = 280,
                                    Height = 40,
                                    Items = { 
                                        Html.X().TextField()
                                            .ID("txtSearch")
                                            .Margins("0 10 0 0")
                                            .EmptyText("Search...")
                                            .Width(215),
                                            
                                        Html.X().Button()
                                            .Icon(Icon.Magnifier)
                                            .Margins("0 20 0 0")
                                            .OnClientClick("Ext.Msg.notify('Search', 'Term : ' + App.txtSearch.getValue());")    
                                    }
                                });
                            }),

                         Html.X().Container()
                            .Layout(LayoutType.VBox)
                    )
)